package CH06;

/**
 * Created by lenovo on 2016/3/26.
 */
public class Game2 {
    public static void main(String[] args) {
        SwordsMan swordsMan = new SwordsMan();
        swordsMan.setName("安度因");
        swordsMan.setLevel(1);
        swordsMan.setBlood(200);

        Magician magician = new Magician();
        magician.setName("麦迪文");
        magician.setLevel(1);
        magician.setBlood(100);

        showBlood(swordsMan);
        showBlood(magician);
        drawFight(swordsMan);
        drawFight(magician);
    }

    static void showBlood(Role role) {
        System.out.printf("%s hp %d%n", role.getName(), role.getBlood());
    }

    static void drawFight(Role role) {
        System.out.print(role.getName());
        role.fight();
    }
}
